using System;
using Lime;

namespace Clandestine.Graphics.Window
{
	public delegate void WindowHandlerEvent();
	
	public class DummyWindowHandler : WindowHandler
	{
		public event WindowHandlerEvent MakeContextCurrentEvent;
		public event WindowHandlerEvent ReleaseContextEvent;
		public event WindowHandlerEvent SwapBuffersEvent;
		
		#region implemented abstract members of Clandestine.Graphics.Window.WindowHandler
		public override void MakeContextCurrent ()
		{
			if (MakeContextCurrentEvent != null)
				MakeContextCurrentEvent();
		}
		
		public override void ReleaseContext ()
		{
			if (ReleaseContextEvent != null)
				ReleaseContextEvent();
		}
		
		public override void ProcessEvents ()
		{
			//throw new System.NotImplementedException();
		}
		
		public override void SwapBuffers ()
		{
			if (SwapBuffersEvent != null)
				SwapBuffersEvent();
		}
		
		public override object Keyboard {
			get {
				throw new System.NotImplementedException();
			}
		}
		
		
		public override object Mouse {
			get {
				throw new System.NotImplementedException();
			}
		}
		
		#endregion
		
		
		public DummyWindowHandler()
		{
			// to create a dummy context, you need an existing context set?????
			// why the hell... ugh. WHATEVER.
			//GraphicsWindow nw = new GraphicsWindow(640, 400, "no-one cares", GameWindowFlags.Default, GraphicsMode.Default, DisplayDevice.Default);
			//GraphicsWindowHandler gwh = new GraphicsWindowHandler(nw);
			//gwh.MakeContextCurrent();
			
			//context = GraphicsContext.CreateDummyContext(new ContextHandle(handle));
			//(context as IGraphicsContextInternal).LoadAll();
			//context.MakeCurrent(null);
		}
	}
}

